import { DeviceType } from "@babylonjs/core/DeviceInput/InputDevices/deviceEnums";
import { DeviceSource } from "@babylonjs/core/DeviceInput/InputDevices/deviceSource";
import { InputKeyStatus } from "../input-key-status";
import { DeviceInputKey } from "../device-information";
import { KeyboardInput } from '../keyboard-input';


/**
 * @internal
 * 生成键盘预设
 * @param device 设备源
 * @returns 键盘预设
 */
const KeyboardPreset = (device: DeviceSource<DeviceType.Keyboard>) => {
    return {
        Shift: new InputKeyStatus(DeviceInputKey.keyboardShift, KeyboardInput.Shift, device),
        A: new InputKeyStatus(DeviceInputKey.keyboardA, KeyboardInput.A, device),
        B: new InputKeyStatus(DeviceInputKey.keyboardB, KeyboardInput.B, device),
        C: new InputKeyStatus(DeviceInputKey.keyboardC, KeyboardInput.C, device),
        D: new InputKeyStatus(DeviceInputKey.keyboardD, KeyboardInput.D, device),
        E: new InputKeyStatus(DeviceInputKey.keyboardE, KeyboardInput.E, device),
        F: new InputKeyStatus(DeviceInputKey.keyboardF, KeyboardInput.F, device),
        G: new InputKeyStatus(DeviceInputKey.keyboardG, KeyboardInput.G, device),
        H: new InputKeyStatus(DeviceInputKey.keyboardH, KeyboardInput.H, device),
        I: new InputKeyStatus(DeviceInputKey.keyboardI, KeyboardInput.I, device),
        J: new InputKeyStatus(DeviceInputKey.keyboardJ, KeyboardInput.J, device),
        K: new InputKeyStatus(DeviceInputKey.keyboardK, KeyboardInput.K, device),
        L: new InputKeyStatus(DeviceInputKey.keyboardL, KeyboardInput.L, device),
        M: new InputKeyStatus(DeviceInputKey.keyboardM, KeyboardInput.M, device),
        N: new InputKeyStatus(DeviceInputKey.keyboardN, KeyboardInput.N, device),
        O: new InputKeyStatus(DeviceInputKey.keyboardO, KeyboardInput.O, device),
        P: new InputKeyStatus(DeviceInputKey.keyboardP, KeyboardInput.P, device),
        Q: new InputKeyStatus(DeviceInputKey.keyboardQ, KeyboardInput.Q, device),
        R: new InputKeyStatus(DeviceInputKey.keyboardR, KeyboardInput.R, device),
        S: new InputKeyStatus(DeviceInputKey.keyboardS, KeyboardInput.S, device),
        T: new InputKeyStatus(DeviceInputKey.keyboardT, KeyboardInput.T, device),
        U: new InputKeyStatus(DeviceInputKey.keyboardU, KeyboardInput.U, device),
        V: new InputKeyStatus(DeviceInputKey.keyboardV, KeyboardInput.V, device),
        W: new InputKeyStatus(DeviceInputKey.keyboardW, KeyboardInput.W, device),
        X: new InputKeyStatus(DeviceInputKey.keyboardX, KeyboardInput.X, device),
        Y: new InputKeyStatus(DeviceInputKey.keyboardY, KeyboardInput.Y, device),
        Z: new InputKeyStatus(DeviceInputKey.keyboardZ, KeyboardInput.Z, device),
        Digit0: new InputKeyStatus(DeviceInputKey.keyboardDigit0, KeyboardInput.Digit0, device),
        Digit1: new InputKeyStatus(DeviceInputKey.keyboardDigit1, KeyboardInput.Digit1, device),
        Digit2: new InputKeyStatus(DeviceInputKey.keyboardDigit2, KeyboardInput.Digit2, device),
        Digit3: new InputKeyStatus(DeviceInputKey.keyboardDigit3, KeyboardInput.Digit3, device),
        Digit4: new InputKeyStatus(DeviceInputKey.keyboardDigit4, KeyboardInput.Digit4, device),
        Digit5: new InputKeyStatus(DeviceInputKey.keyboardDigit5, KeyboardInput.Digit5, device),
        Digit6: new InputKeyStatus(DeviceInputKey.keyboardDigit6, KeyboardInput.Digit6, device),
        Digit7: new InputKeyStatus(DeviceInputKey.keyboardDigit7, KeyboardInput.Digit7, device),
        Digit8: new InputKeyStatus(DeviceInputKey.keyboardDigit8, KeyboardInput.Digit8, device),
        Digit9: new InputKeyStatus(DeviceInputKey.keyboardDigit9, KeyboardInput.Digit9, device),
        Numpad0: new InputKeyStatus(DeviceInputKey.keyboardNumpad0, KeyboardInput.Numpad0, device),
        Numpad1: new InputKeyStatus(DeviceInputKey.keyboardNumpad1, KeyboardInput.Numpad1, device),
        Numpad2: new InputKeyStatus(DeviceInputKey.keyboardNumpad2, KeyboardInput.Numpad2, device),
        Numpad3: new InputKeyStatus(DeviceInputKey.keyboardNumpad3, KeyboardInput.Numpad3, device),
        Numpad4: new InputKeyStatus(DeviceInputKey.keyboardNumpad4, KeyboardInput.Numpad4, device),
        Numpad5: new InputKeyStatus(DeviceInputKey.keyboardNumpad5, KeyboardInput.Numpad5, device),
        Numpad6: new InputKeyStatus(DeviceInputKey.keyboardNumpad6, KeyboardInput.Numpad6, device),
        Numpad7: new InputKeyStatus(DeviceInputKey.keyboardNumpad7, KeyboardInput.Numpad7, device),
        Numpad8: new InputKeyStatus(DeviceInputKey.keyboardNumpad8, KeyboardInput.Numpad8, device),
        Numpad9: new InputKeyStatus(DeviceInputKey.keyboardNumpad9, KeyboardInput.Numpad9, device),
        ArrowLeft: new InputKeyStatus(DeviceInputKey.keyboardArrowLeft, KeyboardInput.ArrowLeft, device),
        ArrowUp: new InputKeyStatus(DeviceInputKey.keyboardArrowUp, KeyboardInput.ArrowUp, device),
        ArrowRight: new InputKeyStatus(DeviceInputKey.keyboardArrowRight, KeyboardInput.ArrowRight, device),
        ArrowDown: new InputKeyStatus(DeviceInputKey.keyboardArrowDown, KeyboardInput.ArrowDown, device),
        Space: new InputKeyStatus(DeviceInputKey.keyboardSpace, KeyboardInput.Space, device),
        Minus: new InputKeyStatus(DeviceInputKey.keyboardMinus, KeyboardInput.Minus, device),
        NumpadSubstract: new InputKeyStatus(DeviceInputKey.keyboardNumpadSubstract, KeyboardInput.NumpadSubstract, device),
        Equal: new InputKeyStatus(DeviceInputKey.keyboardEqual, KeyboardInput.Equal, device),
        NumpadAdd: new InputKeyStatus(DeviceInputKey.keyboardNumpadAdd, KeyboardInput.NumpadAdd, device),
        NumpadDivide: new InputKeyStatus(DeviceInputKey.keyboardNumpadDivide, KeyboardInput.NumpadDivide, device),
        NumpadMultiply: new InputKeyStatus(DeviceInputKey.keyboardNumpadMultiply, KeyboardInput.NumpadMultiply, device),
        NumpadDecimal: new InputKeyStatus(DeviceInputKey.keyboardNumpadDecimal, KeyboardInput.NumpadDecimal, device),
        BracketLeft: new InputKeyStatus(DeviceInputKey.keyboardBracketLeft, KeyboardInput.BracketLeft, device),
        BracketRight: new InputKeyStatus(DeviceInputKey.keyboardBracketRight, KeyboardInput.BracketRight, device),
        Semicolon: new InputKeyStatus(DeviceInputKey.keyboardSemicolon, KeyboardInput.Semicolon, device),
        Quote: new InputKeyStatus(DeviceInputKey.keyboardQuote, KeyboardInput.Quote, device),
        Backslash: new InputKeyStatus(DeviceInputKey.keyboardBackslash, KeyboardInput.Backslash, device),
        Comma: new InputKeyStatus(DeviceInputKey.keyboardComma, KeyboardInput.Comma, device),
        Period: new InputKeyStatus(DeviceInputKey.keyboardPeriod, KeyboardInput.Period, device),
        Slash: new InputKeyStatus(DeviceInputKey.keyboardSlash, KeyboardInput.Slash, device),
        Backquote: new InputKeyStatus(DeviceInputKey.keyboardBackquote, KeyboardInput.Backquote, device),
        Backspace: new InputKeyStatus(DeviceInputKey.keyboardBackspace, KeyboardInput.Backspace, device),
        Enter: new InputKeyStatus(DeviceInputKey.keyboardEnter, KeyboardInput.Enter, device),
        NumpadEnter: new InputKeyStatus(DeviceInputKey.keyboardNumpadEnter, KeyboardInput.NumpadEnter, device),
    };
};


export { KeyboardPreset };